[#ftl]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="${base}/commonjs/flexgrid/css/flexigrid.pack.css" />

<script type="text/javascript" src="${base}/commonjs/jquery1.7.2/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="${base}/commonjs/jquery.select.js"></script>
<script type="text/javascript" src="${base}/commonjs/flexgrid/js/flexigrid.js"></script>
<script type="text/javascript" src="${base}/commonjs/flexgrid/js/myflexigrid.js"></script>
<script type="text/javascript" src="${base}/commonjs/artDialog4/artDialog.source.js?skin=blue"></script>
<script type="text/javascript" src="${base}/commonjs/artDialog4/plugins/iframeTools.source.js"></script>
<title>${(site.name)!"未命名"}站点维护</title>
<script type="text/javascript">
$(function(){
    var channelId = ${(scc.channel.id)!0};
    $("#select_channels").createSelect("${base}/a/${_site_}/channels/list", {}, function(row){
        return [row.id, row.cell[1]+"["+row.cell[0]+"]"];
    },  channelId);
    $("#button_save_index_channel").click(function(){
        var chId = $("#select_channels").val();
        if(!!chId&&channelId-chId!=0){
            $.post("${base}/a/${_site_}/indexchannel.do", {chId: chId}, function(text){
                var result = text;
                if(result.success){
                    window.location.reload();
                }
            });
        }
    });

    $("#bt_reset_pos").click(function(){
        $.post("${base}/a/${_site_}/channels/resetpos.do", {}, function(result){
            if (!!result.success){
                window.location.reload();
            }else{
                alert(result.err);
            }
        });
    });
    
    $("#bt_reload_chs").click(function(){
        $.post("${base}/admin/reload.do", {}, function(result){
            if (!!result.success){
                window.location.reload();
            }else{
                alert(result.err);
            }
        });
    });

    $("#bt_add_channel").click(function(){
      var url = '${base}/a/${_site_}/channels/add';
      art.dialog.open(url, {
        title: "添加新栏目",
        background: '#EEE', // 背景色
        opacity: 0.05,  // 透明度
        width: 450,
        height: 350
      }).lock();
    });
});

</script>
</head>
<body>
<h1>站点基本信息</h1>
<table style="width: 80%;" border=1>
    <tr>
        <th style="width: 200px;">站点ID</th>
        <td>${(_site.id)!0}</td>
    </tr>
    <tr>
        <th>站点名称</th>
        <td>${(_site.name)!"未命名"}</td>
    </tr>
    <tr>
        <th>站点描述</th>
        <td>${(_site.description)!"未设置"}</td>
    </tr>
    <tr>
        <th>站点域名</th>
        <td>${(_site.domain)!"未设置"}</td>
    </tr>
    <tr>
        <th>站点ICP</th>
        <td>${(_site.icp)!"未设置"}</td>
    </tr>
    <tr>
        <th>站点路径</th>
        <td>${(_site.path)!"未设置"}</td>
    </tr>
</table>
<h1>管理项目</h1>
<ul>
    <li><a href="${base}/a/${_site_}/channels/index.html">所有栏目</a>
    <li><a href="${base}/a/${_site_}/templates/index.html">模板管理</a>
    <li><a href="${base}/admin/complets/index.html">组件管理</a>
    <li><a href="${base}/sysdicts">核心字典管理</a>
    <li>首页管理
    <select id="select_channels">
    <option value="0">--请选择首页栏目--</option>
    </select>
    <input type="button" value="保存首页配置" id="button_save_index_channel">
    </li>
</ul>
<input type="button" id="bt_reset_pos" value="顺序格式化">
<input type="button" id="bt_reload_chs" value="栏目重载">
<input type="button" id="bt_add_channel" value="新建栏目">
</body>
</html>